<?php
header("content-type:text/html; charset=utf8");
$servername = "localhost";
$username = "root";
$password = "123";
$dbname = "test";
//mysql_query("set names 'utf8'");
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接	
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

mysqli_query($conn, "SET NAMES 'utf8'");

$stmt = $conn->prepare("UPDATE goods SET name=?,nowPrice=?,originPrice=?,mainImg=?,detailImg=?,sets=?,cates=?,commits=?,referImg=? WHERE id=?");
$stmt->bind_param("sddssssssi",$name,$nowPrice,$originPrice,$mainImg,$detailImg,$sets,$cates,$commits,$referImg,$id);
$name=$_GET["name"];
$nowPrice=$_GET["nowPrice"];
$originPrice=$_GET["originPrice"];
$mainImg=$_GET["mainImg"];
$detailImg=$_GET["detailImg"];
$cates=$_GET["cates"];
$sets=$_GET["sets"];
$commits=$_GET["commits"];
$referImg=$_GET["referImg"];
$id=$_GET["ID"];
$stmt->execute();
echo "更新成功";
$stmt->close();
$conn->close();
?> 